﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("输入一串字符串");
            string str = Console.ReadLine();
            Console.WriteLine("输入的字符串长度为:{0},输入的第一个字和最后一个为：{1}{2}", str.Length, str[0], str[str.Length - 1]);
            for (int i = 0; i < str.Length; i++)
            {
                Console.WriteLine(str[i]);

            }
            string str1 = str;
            str1 = str1.Insert(1, "haha");
            Console.WriteLine(str1);

            //DateTime 时间
            Console.WriteLine("请输入年份");
            int year = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入月份");
            int month = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入日期");
            int day = int.Parse(Console.ReadLine());
            DateTime chus = new DateTime(year, month, day);
            Console.WriteLine("你打的年份为：{0}", chus);

        }
    }
}